package com.sanron.sunweather.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class NetUtils {
	
	public static boolean checkNetwork(Context context){
		ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo[] infos = cm.getAllNetworkInfo();
		for(NetworkInfo info:infos){
			if(info.isAvailable() && info.isConnected()){
				return true;
			}
		}
		return false;
	}
}
